<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<title>工作总结</title>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/html5.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/sty.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/page.css">
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<style type="text/css">
	.f-w{font-weight: bold;}
    /*.input-text{border: none !important}*/
    textarea{width: 95% !important}
    .textarea{height: 50px !important}
    td{font-size: 14px !important;/*border: solid 1px #ddd;*/border: none !important}
    .table-bordered th,table.dataTable{border-collapse: collapse !important;border: none !important }
    .table-bg thead th{background-color:#e9f3fc !important }
    .page-container{margin-bottom: 25px}
    button{margin-left: 20px }
    .bg-c,.normalEvenTD{
    background: #f5fafe;
    }
    .normalOddTD{
    background: #FFFFFF;
    }
</style>
</head>


<body>
<div class="page-container">

    <div style="background: ">
        <div class="cl pd-5 bg-1 bk-gray">
            <neq name="Think.session.USER_AUTH.oa_level" value="3">
                <span class="l">
                    <a href="javascript:;" onclick="work_all_del()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                    <a class="btn btn-primary radius"  style="text-decoration:none" class="ml-5"  onclick="work_html('新增总结','{:U("Work/add")}','10002')" href="javascript:;" title="新增总结">新增总结</a>
                </span>
            </neq>
            <form action="{:U('Work/index')}" method="post">
                <div style="float:right" style="width:450px;">
                    <eq name="Think.session.USER_AUTH.oa_level" value="2"> <!-- 销售经理用户  -->
                        <select name="search_type" class="input-text" style="width:80px;">
                            <option value="all" <eq name="search_type" value="all">selected</eq> >全部</option>
                            <option value="my" <eq name="search_type" value="my">selected</eq> >我的</option>
                            <option value="xiashu" <eq name="search_type" value="xiashu">selected</eq> >下属</option>
                        </select>
                    </eq>
                    <input type="text" onfocus="WdatePicker()" id="logmin" name="date_begin" value="{$date_begin}" class="input-text Wdate" style="width:120px;">
                    -
                    <input type="text" onfocus="WdatePicker()" id="logmax" name="date_end" value="{$date_end}" class="input-text Wdate" style="width:120px;">
                    <button class="btn btn-success" type="submit" style="margin-left:10px;margin-right:10px;">搜索</button>
                </div>
            </form>
        </div>
    	<div class="mt-15">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">

                <table class="list table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
                    <thead>
                        <tr class="text-c" role="row">
                            <th width="25" rowspan="1" colspan="1" aria-label="" >
                                <input type="checkbox" name="" value="">
                            </th>
                            <th width="80" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >序号</th>
                            <th width="80" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >添加人</th>
                            <th style="width:auto" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" >总结内容</th>
                            <th width="80" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"  >总结日期</th>
                            <th width="120" rowspan="1" colspan="1" aria-label="操作" >操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="workList" id="val" empty="$empty">
                            <tr class="text-c odd" role="row">
                                <td><input type="checkbox" value="{$val.id}" class="check_box"></td>
                                <td>{$i+($p-1)*10}</td>
                                <td>{$val.uid|get_user_name}</td>
                                <td>
                                    <div class="text-overflow" style="width:500px;margin:0px auto">
                                        {$val.content}
                                    <div>
                                </td>
                                <td>{$val.date|date='Y-m-d',###}</td>
                                <td style="text-align:left">
                                    <a style="text-decoration:none" class="ml-5" onclick="work_html('总结详情','{:U("Work/detail",array("id"=>$val["id"]))}','10002')" href="javascript:;">详情</a>
                                    <if condition="$Think.session.USER_AUTH.oa_level eq 4">  <!-- 管理员身份 -->
                                        <a style="text-decoration:none" class="ml-5" onclick="work_del('{:U("Work/del",array("id"=>$val["id"],"p"=>$p))}')" href="javascript:;">删除</a>
                                        <a style="text-decoration:none" class="ml-5" onclick="work_html('修改总结','{:U("Work/edit",array("id"=>$val["id"]))}','10002')" href="javascript:;">修改</a>
                                    <else/>  <!-- 添加人身份 -->
                                        <eq name="Think.session.USER_AUTH.userid" value="$val.uid">
                                            <a style="text-decoration:none" class="ml-5" onclick="work_del('{:U("Work/del",array("id"=>$val["id"],"p"=>$p))}')" href="javascript:;">删除</a>
                                            <if condition="date('Y-m-d',$val['date']) eq date('Y-m-d')">
                                                <a style="text-decoration:none" class="ml-5" onclick="work_html('修改总结','{:U("Work/edit",array("id"=>$val["id"]))}','10002')" href="javascript:;">修改</a>
                                            </if>
                                        </eq>
                                    </if>
                                </td>
                            </tr>
                        </volist>

                    </tbody>
                </table>
                <div class="digg">{$page}</div>
            </div>
        </div>
    </div>

</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/WdatePicker.js"></script>
<!--/_footer /作为公共模版分离出去-->


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">

// 新增 修改 详情
function work_html(title,url,id,w,h){
    layer_show(title,url,600,500);
}

// 删除
function work_del(url){
    layer.confirm('确认要删除吗？', {icon: 3, title:'删除'}, function(index){
        //$(obj).parents("tr").remove();
        layer.msg('已删除!',{icon:1,time:1000});
        window.location.href = url;
    });
}

// 批量删除
function work_all_del(){
    layer.confirm('确认要删除吗？', {icon: 3, title:'批量删除'},function(index){
        var wid = '';
        for (var i = $('.check_box').length - 1; i >= 0; i--) {
            if($('.check_box').eq(i).is(':checked')){
                wid = wid.length==0 ? $('.check_box').eq(i).val() : wid+','+$('.check_box').eq(i).val();
            }
        }
        if(wid.length == 0){
            layer.msg('请选择要删除的工作总结!',{icon:2,time:1000});
        }else{
            layer.msg('已删除!',{icon:1,time:1000});
            var url = "{:U('Work/del',array('id'=>wid,'p'=>$p))}";
            url = url.replace('wid',wid);
            window.location.href = url;
        }
    });
}



$(function(){
    ///////datagrid选中行变色与鼠标经过行变色///////////////
    var dtSelector = ".list";
    var tbList = $(dtSelector);

    tbList.each(function() {
    var self = this;
    $("tr:even:not(:first)", $(self)).addClass("normalEvenTD"); // 从标头行下一行开始的奇数行，行数：（1，3，5...）
    $("tr:odd", $(self)).addClass("normalOddTD"); // 从标头行下一行开始的偶数行，行数：（2，4，6...）

    // 鼠标经过的行变色
    // $("tr:not(:first)", $(self)).hover(
    // function () { $(this).addClass('hoverTD');$(this).removeClass('table-td-content'); },
    // function () { $(this).removeClass('hoverTD');$(this).addClass('table-td-content'); }
    // );

    // 选择行变色
    // $("tr", $(self)).click(function (){
    // var trThis = this;
    // $(self).find(".trSelected").removeClass('trSelected');
    // if ($(trThis).get(0) == $("tr:first", $(self)).get(0)){
    // return;
    // }
    // $(trThis).addClass('trSelected');
    // });
    });
});
</script>

</body>
</html>
